from sys import setrecursionlimit

setrecursionlimit(1005)
n = int(input())
a = list(map(int, input().split()))
a = [(i, a[i]) for i in range(n)]

rt = a[0]
v = [[-1, -1] for _ in range(1005)]  # 记录左右孩子
d = [0 for _ in range(1005)]  # 记录深度的桶
d[0] = 1


def add(fa, x, dep=1):
    idx, isR = fa[0], x[1] > fa[1]
    if v[idx][isR] == -1:
        v[idx][isR] = x
        d[dep] += 1
    else:
        add(v[idx][isR], x, dep + 1)


for i in a[1:]:
    add(rt, i)

if n == 1: print('1 + 0 = 1')

for i in range(1000, 0, -1):
    if d[i]:
        print(f'{d[i]} + {d[i-1]} = {d[i]+d[i-1]}')
        break